var fs = require("fs");
//改变js
var filePathJs = "./jsAndTs/GPb.js";
fs.readFile(filePathJs, "utf8", (err, files) => {
    var result = files.replace("require(\"protobufjs\/minimal\")", "protobuf");
    result += "\nwindow.GPb = $root.GPb;"
    fs.writeFile(filePathJs, result, "utf8", (err) => {
        if (err) return console.log(err);
    });
})
//改变.d.ts
var filePathTs = "./jsAndTs/GPb.d.ts";
fs.readFile(filePathTs, "utf8", (err, file) => {
    var result = file.replace("import * as $protobuf from \"protobufjs\";", "");
    result = result.replace("export ", "");
    fs.writeFile(filePathTs, result, "utf8", (err) => {
        if (err) return console.log(err);
    });
})

